package ipt.capitulo24;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class PrimerServlet extends HttpServlet { 
public void service(HttpServletRequest req, HttpServletResponse res)
throws IOException
{
Enumeration parametros;
String parametro;
String valor;
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML><HEAD><TITLE>Ejemplo de servlet </TITLE></HEAD>");
out.println("<BODY BGCOLOR=#FFFFFF>");
out.println("<h1>Manual Imprescindible de Java 2 v1.6</h1>");
out.println("<TABLE BORDER=2>");
parametros = req.getParameterNames();
while (parametros.hasMoreElements()) {
parametro = (String) parametros.nextElement();
valor = req.getParameter(parametro);
out.println("<tr><td>nombre: " + parametro + "</td>");
out.println("<td>valor: " + valor +"</td></tr>");
}
out.println("</TABLE><br><br>");
out.println("<a href=http://localhost:8084/servlets-examples/VerPrimerSerlet.html>Regresar</a>");
out.println("</BODY></HTML>");
}
public String getServletInfo() {
return "Primer servlet";
}
}